package xin.zhiyin.控制.system.用户;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import xin.zhiyin.实体.用户Entity;
import xin.zhiyin.服务.用户Service;

@Controller
@RequestMapping(path = "/system/user")
public class 用户Controller {
    @Autowired
    private 用户Service 用户Service;
    @RequestMapping (path = "/add" ,method = RequestMethod.POST)
    public void 新增用户(
            @RequestParam String loginName,
            @RequestParam String loginPassword,
            @RequestParam String email,
            @RequestParam String phoneNumber,
            @RequestParam String headImage
    )
    {
        用户Entity u = new 用户Entity();
        u.setLoginName(loginName);
        u.setLoginPassword(loginPassword);
        u.setEmail(email);
        u.setPhoneNumber(phoneNumber);
        u.setHeadImage(headImage);
        用户Service.新增用户(u);
    }
    public String 用户列表()
    {
        return "system/user/user_list";
    }
}
